{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {
    "collapsed": true,
    "pycharm": {
     "is_executing": false
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "text": [
      "1.4.0\n"
     ],
     "output_type": "stream"
    }
   ],
   "source": [
    "%matplotlib inline\n",
    "import torch\n",
    "import torch.nn as nn\n",
    "import numpy as np\n",
    "import pandas as pd\n",
    "import sys\n",
    "sys.path.append(\"..\") \n",
    "import d2l as d2l\n",
    "print(torch.__version__)\n",
    "torch.set_default_tensor_type(torch.FloatTensor)\n",
    "import matplotlib.pyplot as plt\n",
    "from sklearn.ensemble import RandomForestRegressor"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "outputs": [
    {
     "data": {
      "text/plain": "<matplotlib.collections.PathCollection at 0x1e1b470edc8>"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 30
    },
    {
     "data": {
      "text/plain": "<Figure size 432x432 with 1 Axes>",
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYoAAAF3CAYAAAC7cgzXAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjMsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+AADFEAAAgAElEQVR4nO3dfZQcV3km8OftVklqCeK2QWTxWMKKEdbaCEvxYJsoySIvsU0cy8I2yAbvQgJ4s4tDbIgScfBi2TgrBW0CnMSbYAgbdm2w/AGT8UcQh0jZTbSR0YgZoYyRgrEtWa0kKLZGgDSSembe/aO7RtU1VbdudVd1V3U/v3N0NN1TXX1reua+dd/7JaoKIiKiMIVOF4CIiLKNgYKIiIwYKIiIyIiBgoiIjBgoiIjIiIGCiIiMUg0UInKNiOwXkedEZH3IMe8RkWdFZFREvppmeYiIKD5Jax6FiBQB/COAXwFwCMAuALeo6rOeY5YAeATAlap6VERep6o/SqVARETUlDRbFJcBeE5Vn1fV0wA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qq5AbY2n37UtnIhchdp6O5cBWA7gUhH5ZdSWWzisqpeo6psBfDP+pRO1hoGCesVLqrqj/vWDAH7R870tACAirwLwCwAeFZERAF8A8PqAc20B4N7Z3+y+HrUF2LaKyF4A6wBcHKN8V9X/DQP4LoClqAWOvQDeISJ/ICK/pKrHYpyTKBGzOl0Aojbxr1XjfXy8/n8BwJiqLo84198DeKOILEBtZdj76s//MYA/UtVBEXk7gA0Br52ovw/qG23Nrj8vADaq6hf8LxCRS1Fbv2ejiHxLVe+NKB9RotiioF6xSETeVv/6FtTSRA20tjPdCyLybqBWkYvIJQHHKYBvoLaw2vdV9eX6t84CUKl//f6QcryIM8tWXw/AqX+9FcBv1Fs1EJE+EXmdiJwL4ISqPgjgvwP4ecvrJUoMWxTUK74P4P0i8gUAPwDwpyHHvQ/An4rIXahV4g+jtoqo3xYAu1DbX9m1AbW0VQW1LV4XB7zuiwD+UkS+A+CvUW/NqOq3ROTfAvj7+o6+PwVwK4A3AtgsIlMAqqjtMU7UVlw9lrqeiJwP4Ml6ZzARxcTUExERGbFFQURERmxREBGREQMFEREZMVAQEZERAwURERkxUBARkREDBRERGf1/pVKtk7i5pBkAAAAASUVORK5CYII=\n"
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "all_data = pd.read_csv(r'E:\\02Projects\\papers\\chl_model\\data\\seawifs\\train_dataset2.csv')\n",
    "all_data = all_data.rename(columns={'Unnamed: 0':'Id'})\n",
    "all_data.head()\n",
    "\n",
    "plt.figure(1,figsize=(6,6))\n",
    "plt.xlabel('pre values')\n",
    "plt.ylabel('real values')\n",
    "plt.xlim([0,0.6])\n",
    "plt.ylim([0,0.6])\n",
    "plt.scatter(all_data.in_situ_chl,all_data.NASA_chlor_a)"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "outputs": [],
   "source": [
    "n_train_len = 1778\n",
    "all_features =  all_data.iloc[:,1:-2]"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "outputs": [
    {
     "name": "stdout",
     "text": [
      "Index(['rrs443', 'rrs490', 'rrs510', 'rrs555', 'rrs670', 'rrs443/rrs490',\n       'rrs443/rrs510', 'rrs443/rrs555', 'rrs443/rrs670', 'rrs490/rrs443',\n       'rrs490/rrs510', 'rrs490/rrs555', 'rrs490/rrs670', 'rrs510/rrs443',\n       'rrs510/rrs490', 'rrs510/rrs555', 'rrs510/rrs670', 'rrs555/rrs443',\n       'rrs555/rrs490', 'rrs555/rrs510', 'rrs555/rrs670', 'rrs670/rrs443',\n       'rrs670/rrs490', 'rrs670/rrs510', 'rrs670/rrs555'],\n      dtype='object')\n"
     ],
     "output_type": "stream"
    }
   ],
   "source": [
    "numeric_features = all_features.dtypes[all_features.dtypes != 'object'].index\n",
    "print(numeric_features)"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "outputs": [],
   "source": [
    "all_features[numeric_features] = all_features[numeric_features].apply(\n",
    "    lambda x: (x - x.mean()) / (x.std()))\n",
    "# 标准化后，每个数值特征的均值变为0，所以可以直接用0来替换缺失值\n",
    "all_features[numeric_features] = all_features[numeric_features].fillna(0)"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "outputs": [
    {
     "data": {
      "text/plain": "(2400, 25)"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 12
    }
   ],
   "source": [
    "all_features = pd.get_dummies(all_features, dummy_na=True)\n",
    "all_features.shape # (2919, 331)"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "outputs": [
    {
     "name": "stdout",
     "text": [
      "train_feature count:1778,train_label count:1778\ntest_feature count:622,test_label count:622\n"
     ],
     "output_type": "stream"
    }
   ],
   "source": [
    "train_feature = all_features.iloc[:n_train_len,:]\n",
    "test_feature = all_features.iloc[n_train_len:,]\n",
    "\n",
    "train_label = all_data.iloc[:n_train_len,-2:-1]\n",
    "test_label = all_data.iloc[n_train_len:,-2:-1]\n",
    "\n",
    "print(\"train_feature count:{},train_label count:{}\".format(train_feature.shape[0],train_label.shape[0]))\n",
    "print(\"test_feature count:{},test_label count:{}\".format(test_feature.shape[0],test_label.shape[0]))\n",
    "\n"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "outputs": [
    {
     "name": "stderr",
     "text": [
      "D:\\Users\\ASUS\\anaconda3\\envs\\deeplab\\lib\\site-packages\\ipykernel_launcher.py:2: DataConversionWarning: A column-vector y was passed when a 1d array was expected. Please change the shape of y to (n_samples,), for example using ravel().\n  \n"
     ],
     "output_type": "stream"
    },
    {
     "data": {
      "text/plain": "RandomForestRegressor()"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 14
    }
   ],
   "source": [
    "\n",
    "rfr=RandomForestRegressor()\n",
    "rfr.fit(train_feature,train_label)"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "outputs": [
    {
     "data": {
      "text/plain": "<matplotlib.collections.PathCollection at 0x1e1b42d3b08>"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 25
    },
    {
     "data": {
      "text/plain": "<Figure size 432x432 with 1 Axes>",
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYoAAAF3CAYAAAC7cgzXAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz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H8CYBfCHi9RJFhj4LS4ocAPi4iXwXwIwBf9jjuTgBfFpEHUL6JP4VyFVGnzQD2ory/smUdysNWRZS3eJ3n8r6vAfhrEfk+gL9FpTejqi+IyL8G8A+VHX3fAnAXgPcA2CQiEwBKKO8xTtRQrB5LbU9ErgLw7cpkMBGFxKEnIiIyYo+CiIiM2KMgIiIjBgoiIjJioCAiIiMGCiIiMmKgICIiIwYKIiIy+v9V14t6Lut+vgAAAABJRU5ErkJggg==\n"
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "\n",
    "def flatten(a):\n",
    "    if not isinstance(a, (list, )):\n",
    "        return [a]\n",
    "    else:\n",
    "        b = []\n",
    "        for item in a:\n",
    "            b += flatten(item)\n",
    "    return b\n",
    "\n",
    "predictVal = rfr.predict(test_feature)\n",
    "\n",
    "plt.figure(1,figsize=(6,6))\n",
    "plt.xlabel('pre values')\n",
    "plt.ylabel('real values')\n",
    "plt.xlim([0,0.6])\n",
    "plt.ylim([0,0.6])\n",
    "plt.scatter(predictVal,test_label)"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "outputs": [
    {
     "name": "stdout",
     "text": [
      "pre max:0.38379866666666673,\nreal value max:in_situ_chl    0.613\ndtype: float64\n"
     ],
     "output_type": "stream"
    }
   ],
   "source": [
    "print(\"pre max:{},\\nreal value max:{}\".format(predictVal.max(),test_label.max()))\n"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "outputs": [],
   "source": [
    "\n"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  },
  "pycharm": {
   "stem_cell": {
    "cell_type": "raw",
    "source": [],
    "metadata": {
     "collapsed": false
    }
   }
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}